﻿<%@ page language="java" pageEncoding="UTF-8"
	import="com.yb.util.comm.RequestUtil,com.yb.domain.member.TsSysuser,com.yb.util.comm.Contants;"
	contentType="text/html; charset=utf-8"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<title>${tgBrand.name}-幸福兄弟-幸福兄弟拼购网-${pcategory.name}-${category.name}-商家会员</title>
	<meta name="description" content="幸福兄弟盐城拼购第一网www.9898sj.com是幸福兄弟营销策划有限公司旗下品牌项目。幸福兄弟盐城拼购第一网是专门针对建材、家具、电器进行同城拼购的一个网站。将全城千万消费者聚拢在一起，用量来获得最低的购买价格。网站聚集了全城1000个知名优质品牌，消费者足不出户就能完成对盐城建材、家具、电器市场进行最深刻的了解，通过拼购网购买是免费的，消费者不需要花一分钱就能实现最省钱、省心、舒心的购买。幸福兄弟盐城拼购第一网将帮助1000个优质品牌企业最大程度的宣传全城，帮助品牌企业好的口碑得到良好的传播，从而实现最好的销售。希望幸福兄弟盐城拼购第一网能为您的幸福生活、您的成功带来帮助！幸福生活，从拼购开始。公司地址，盐城市南城河路9号（迎宾桥北桥头东侧）；联系电话：0515-88175689  88175528"/>
	<meta name="keywords" content="幸福兄弟，幸福兄弟盐城拼购第一网，幸福兄弟拼购，幸福兄弟拼购网，盐城拼购，盐城拼购，盐城建材拼购，盐城家具拼购，盐城电器拼购，建材拼购，家具拼购，电器拼购"/>
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
		<meta http-equiv="description" content="This is my page" />
		<link rel="Shortcut Icon" type="image/x-icon"
			href="<%=basePath%>resource/img/favicon.ico" media="screen" />
		<link href="<%=basePath%>resource/css/cssbrand.css" rel="stylesheet"
			type="text/css" />
		<script type="text/javascript"
			src="<%=basePath%>resource/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>resource/js/jquery-1.4.2.js"></script>
		<style type="text/css">
			.left2-4 SPAN {
				MARGIN-TOP: 0px; WIDTH: 78px; DISPLAY: inline-block; FLOAT: right; HEIGHT: 30px; COLOR: #4e4347; FONT-SIZE: 12px; FONT-WEIGHT: 600; PADDING-TOP: 2px;padding-right: 3px;line-height: 30px;
			}	
			#left .leftBody {
				WIDTH: 256px; BACKGROUND: url(<%=basePath %>resource/img/zhongjian.jpg) repeat-y
			}
			#left .leftTop {
				WIDTH: 256px; background: url("<%=basePath %>resource/img/index/bd.gif") no-repeat; HEIGHT: 34px
			}
			#left .leftBotton {
				WIDTH: 256px; BACKGROUND: url(<%=basePath %>resource/img/chuyidiandian.jpg) 0px -5px no-repeat; HEIGHT: 5px;
			}
			.tijiao {
				BACKGROUND-IMAGE: url(<%=basePath %>resource/img/index/tijiao.jpg); TEXT-ALIGN: center; PADDING-BOTTOM: 5px; LINE-HEIGHT: 28px; PADDING-LEFT: 90px; WIDTH: 65px; BACKGROUND-REPEAT: no-repeat; BACKGROUND-POSITION: right center; FLOAT: left; HEIGHT: 28px; COLOR: #fff; FONT-SIZE: 14px; FONT-WEIGHT: bold; PADDING-TOP: 5px
			}
			.tijiao A {
				COLOR: #fff
			}
			.tijiao A:hover {
				COLOR: #036
			}
			.quandianping1 {
				BORDER-BOTTOM: #9c9 1px dashed; BORDER-LEFT: #9c9 1px dashed; LINE-HEIGHT: 24px; BACKGROUND-COLOR: #f7f5f4; FONT-SIZE: 12px; BORDER-TOP: #9c9 1px dashed; BORDER-RIGHT: #9c9 1px dashed;text-align: left;
			}
			.quandianping2 {
				PADDING-BOTTOM: 5px; LINE-HEIGHT: 20px; PADDING-LEFT: 5px; FONT-SIZE: 14px; PADDING-TOP: 5px
			}
		</style>
	</head>
	<script>
		function drawJoinMem(count){
			if(count == undefined || count == null || count == ''){
				count = '0';
			}
			var str = '';
			switch(count.length){
				case 1:;
				case 2:
				   if(parseInt(count,10)<10){
				   	 str += '<img src="<%=basePath%>resource/img/0.jpg"/><img style="margin-left:1px;" src="<%=basePath%>resource/img/'+parseInt(count,10)+'.jpg"/>';
				   }else{
				   	 str += '<img src="<%=basePath%>resource/img/'+Math.floor(count/10)+'.jpg"/><img style="margin-left:1px;" src="<%=basePath%>resource/img/'+(count%10)+'.jpg"/>';
				   }
				   break;
				case 3:
				   	 str += '<img src="<%=basePath%>resource/img/'+parseInt(count.substr(0,1),10)+'.jpg"/><img style="margin-left:1px;" src="<%=basePath%>resource/img/'+parseInt(count.substr(1,1),10)+'.jpg"/><img style="margin-left:1px;" src="<%=basePath%>resource/img/'+parseInt(count.substring(2),10)+'.jpg"/>';
				   break;
			}
			document.write(str);
		}
	</script>
	<body id="top">
		<div id="top-bg">
			<div id="top-1" align="center">
				<div class="top-1-left" align="left">
					<a href="javascript:addfavorite()" title="收藏本站">收藏本站</a>
				</div>
				<%
					String userid = "";
					String userType = "";
					TsSysuser tsSysuser = (TsSysuser) RequestUtil
							.getLoginUserFromSession(request, Contants.SESSION_USER);
					if (tsSysuser == null) {
				%>
				<div class="top-1-right">
					欢迎登录幸福兄弟拼购网！ |
					<a href="<%=basePath%>login.html" target="_top" title="登录">登录</a>
					|
					<a href="<%=basePath%>user/goForWordRegister.shtml" target="_top"
						title="免费注册">免费注册</a> |&nbsp;&nbsp;
				</div>
				<%
					} else {
						userid = tsSysuser.getId().toString();
						userType = tsSysuser.getType();
				%>
				<div class="top-1-right">
					欢迎<%=tsSysuser.getUsername()%>登录幸福兄弟拼购网！ |
					<a href="<%=basePath%>loginsuccess.jsp" target="_top" title="个人管理">个人管理</a>
					|
					<a href="<%=basePath%>user/qiantanExit.shtml" target="_top"
						title="退出登录">退出登录</a>
				</div>
				<%
					}
				%>
			</div>
			</div>
			<div id="banner3">
				<img src="<%=basePath%>${tgBrand.brandPic}" width="1000" height="280" title="${tgBrand.name}" />
			</div>
			<div id="nav" align="center">
				<table width="1000" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td
							style="background: url(../resource/img/index/sh-1.jpg) no-repeat; height: 39px; width: 11px">
							&nbsp;
						</td>
						<td width="982"
							style="background: url(../resource/img/index/sh-2.jpg) repeat-x; line-height: 33px">
							<div id="nav-1" align="left">
								<a href="<%=basePath%>home.shtml">首页</a> &gt;
								<a
									href="<%=basePath%>showCategory.shtml?categoryId=${category.id}&pid=${pcategory.id}">${pcategory.name}</a>
								&gt;
								<a
									href="<%=basePath%>showCategory.shtml?categoryId=${category.id}&pid=${pcategory.id}">${category.name}</a>
								&gt;
								<a href="#">${tgBrand.name}</a>
							</div>

						</td>
						<td
							style="background: url(../resource/img/index/sh-3.jpg) no-repeat; height: 39px; width: 7px">
							&nbsp;
						</td>
					</tr>
				</table>
			</div>

			<div id="content" >
				<div id="left" align="center">
					<div class="leftTop" ></div>
					<div class="leftBody" align="center" style="margin-top:0px;">
					<div class="left1" style="margin-top:0px;">
					<!-- <div class="left1-t" align="left">
							抢购必读：
						</div> -->	
						<div class="left1-c" align="left">
							<p style="font-size: 13px;font-weight: 200;text-indent:2em; margin-top: 0px">
								${tgBrand.announcement}
							</p>
							<p style=" font-size: 14px;font-weight: 200;letter-spacing: 2px;text-indent:2em;line-height:200% ">
								请真实填写商家咨询了解的相关信息，如果不实而造成纠纷，后果自负。为了舒心拼购，请主动保留相关证据。
							</p>
						</div>
						<div class="join-info" align="center">
							<span><img src="<%=basePath %>resource/img/t-b1.gif"/><script>drawJoinMem('${count}')</script><img src="<%=basePath %>resource/img/t-b2.gif"/></span>
						</div>
						<div class="left2-2">
						<form target="joinFrame" action="<%=basePath %>buyrecord/saveOrUpdate.shtml" method="post">
							<table width="240px" border="0" style="border: 0px red solid;" cellspacing="0" cellpadding="0">
								<tr style="height: 100px;">
									<td align="left">
										<div class="left2-4" align="center" style="background: url('<%=basePath %>resource/img/canjia.jpg') no-repeat;height:75px">
											<nobr><span>
											<s:if test='%{#tgBrand.phone == null||#tgBrand.phone == ""}'>暂无资料</s:if>
											<s:else>
												${tgBrand.phone}
											</s:else>
											</span></nobr>
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top: 20px;">
											<tr>
												<td width="95" align="right">
													<div class="quandianping">
														<label for="textfield">
															真实姓名：
														</label>
													</div>
												</td>
												<td align="left">
													<div class="quandianping">
														<input type="text" name="tpRecord.name" maxlength="25"
															id="username" style="width: 100px;"/><em style="color: #F00">*</em>
													</div>
												</td>
											</tr>
											<tr>
												<td align="right">
													<div class="quandianping">
														<label for="textfield2">
															手机：
														</label>
														<input type="hidden" name="tpRecord.brandId" id="brandId" value="<s:property value="#tgBrand.id"/>" />
													</div>
												</td>
												<td align="left">
													<div class="quandianping">
														<input type="text" name="tpRecord.pho" maxlength="18"
															id="phone" style="width: 100px;" /><em style="color: #F00">*</em>
													</div>
												</td>
											</tr>
											<tr>
												<td align="right">
													<div class="quandianping">
														<label for="textfield3">
															备用电话：
														</label>
													</div>
												</td>
												<td align="left">
													<div class="quandianping">
														<input type="text" name="tpRecord.tel" maxlength="18"
															id="tel" style="width: 100px;" />
													</div>
												</td>
											</tr>
											<tr>
												<td align="right">
													<div class="quandianping">
														<label for="textfield4">
															小区名称：
														</label>
													</div>
												</td>
												<td align="left">
													<div class="quandianping">
														<input type="text" name="tpRecord.address" maxlength="50"
															id="address" style="width: 100px;" /><em style="color: #F00">*</em>
													</div>
												</td>
											</tr>
											<tr>
												<td align="right">
													<div class="quandianping">
														<label for="select">
															参加拼购时间：
														</label>
													</div>
												</td>
												<td align="left">

													<div class="quandianping">
														<input name="tpRecord.partTime" maxlength="25" id="parttime"
															onFocus="WdatePicker({firstDayOfWeek:7,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
															class="Wdate" style="width: 100px;"/><em style="color: #F00">*</em>
													</div>
												</td>
											</tr>
											<tr>
												<td align="right">
													<div class="quandianping">
														<label for="textfield5">
															购买数量：
														</label>
													</div>
												</td>
												<td align="left">
													<div class="quandianping">
														<input type="text" name="tpRecord.buyNum" id="num"
															maxlength="5" style="width: 100px;" /><em style="color: #F00">*</em>
													</div>
												</td>
											</tr>
											<tr>
												<td align="right">
													<div class="quandianping">
														<label for="textfield6">
															产品名称：
														</label>
													</div>
												</td>
												<td align="left">
													<div class="quandianping">
														<input type="text" name="tpRecord.proName" maxlength="100"
															id="wuname" style="width: 100px;" />
													</div>
												</td>
											</tr>
											<tr>
												<td align="right">
													<div class="quandianping">
														<label for="textfield7">
															产品型号：
														</label>
													</div>
												</td>
												<td align="left">
													<div class="quandianping">
														<input type="text" name="tpRecord.model" id="type"
															maxlength="100" style="width: 100px;" />
													</div>
												</td>
											</tr>
											<tr>
												<td align="right">
													<div class="quandianping">
														<label for="textfield8">
															咨询成交单价：
														</label>
													</div>
												</td>
												<td align="left">
													<div class="quandianping">
														<input type="text" name="tpRecord.price" id="xun"
															maxlength="5" style="width: 100px;"/>
													</div>
												</td>
											</tr>
											<tr>
												<td align="right">
													<div class="quandianping">
														<label for="textfield9">
															咨询成交总价：
														</label>
													</div>
												</td>
												<td align="left">
													<div class="quandianping">
														<input type="text" name="tpRecord.total" maxlength="5"
															id="xuntotal" style="width: 100px;" />
													</div>
												</td>
											</tr>
											<tr>
												<td align="right">
													<div class="quandianping">
														<label for="textfield10">
															咨询成交折扣：
														</label>
													</div>
												</td>
												<td align="left">
													<div class="quandianping">
														<input type="text" name="tpRecord.zhekou" maxlength="4"
															id="zhekou" style="width: 100px;"/>
													</div>
												</td>
											</tr>
											<tr>
												<input type="hidden" name="tpRecord.categoryId" value="${tgBrand.categoryId} "
													id="categoryId" />
												<input type="hidden" value="<%=userid%>" id="userid" name="tpRecord.userId" />
												<input type="hidden" value="0" id="autding" name="tpRecord.autding" />
												<td align="right">
													<div class="quandianping">
														<label for="textfield11">
															咨询时间：
														</label>
													</div>
												</td>
												<td align="left">
													<div class="quandianping">
														<input type="text" name="tpRecord.queryDate" maxlength="25"
															id="time"
															onFocus="WdatePicker({firstDayOfWeek:7,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
															class="Wdate" style="width: 100px;" />
													</div>
												</td>
											</tr>
										</table>
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td
													style="padding-top: 10px; padding-left: 10px; padding-right: 10px">
													<div class="quandianping1">
														<em style="color: #F00">*</em>为了防止虚假信息、弄虚作假恶意现象的出现，影响消费者参加拼购的利益，是凡参加拼购的业主
														必须缴纳定金（200元）；购买时直接冲抵货款。
													</div>

												</td>
											</tr>
											<tr>
												<td height="30px" align="center">
													<div class="tijiao">
														<input type="submit" style="display: none" id="cjpgbtn"/><a href="javascript:add();">提&nbsp;&nbsp;交&nbsp;&nbsp;</a>
													</div>
												</td>
											</tr>
											<tr>
												<td height="10px">
													&nbsp;
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
							</form>
							<iframe name="joinFrame" id="joinFrame" src="" style="display: none"></iframe>
						</div>
					</div>
					<div class="left1111" align="center">
						<div class="left3-1" align="left">
							<nobr>已参加<font
								style="font-weight: bold; padding-left: 3px; padding-right: 3px;">${tgBrand.shortName}</font>拼购的业主：</nobr>
						</div>
						<div class="left1-2">
						<table width="100%" cellpadding="0" cellspacing="0">
								<s:if test="%{#memberlist == null||#memberlist.size()==0}">
										<tr ><td align="left" colspan="2" style="border-bottom: 1px dotted #C2D5E3;padding-left: 10px;">暂时没有业主参与&nbsp;&nbsp;</td></tr>
								</s:if>
								<s:iterator value="#memberlist" var="member">
											<s:if test="%{#member.userId == #session.userinfo.id}">
												<s:set name="joinFlag" value="true" ></s:set>
											</s:if>
											<tr style="border-bottom: 1px solid #C2D5E3"><td align="left" width="120px" style="border-bottom: 1px dotted #C2D5E3;padding-left: 10px;">${member.showName}</td><td align="left" style="border-bottom: 1px dotted #C2D5E3;color: #D2A97D">${member.partTimeFormat}</td></tr>
								</s:iterator>
							</table>
						</div>
					</div>
					</div>
					<div class="leftBotton"></div>
				</div>
				<div id="right">
					<script>
      var bid;
   try{ bid=document.getElementById("brandId").value;}catch(e){}
  var tipFlag = false;
   function addResult(mes){
   	if(!tipFlag){
			if(mes == "1"){
				alert("申请参加拼购成功");
				$("#username").val("");
			      $("#phone").val("");
			        $("#address").val(""); 
			         $("#tel").val(""); 
			         $("#parttime").val("");
			         $("#num").val("");
			         $("#xun").val("");
			         $("#type").val("");
			         $("#wuname").val("");
			         $("#xuntotal").val("");
			          $("#zhekou").val("");
			         $("#time").val("");
			}else{
				alert("申请参加拼购失败");
			}
		}
			tipFlag = false;
		}
</script>
					<IFRAME id="test" name="test" frameBorder=0 scrolling=no
						src="../brand/brandDetail.shtml?id=${tgBrand.id}" width="100%"
						height="0"></IFRAME>
				</div>
			</div>
			<iframe src="<%=basePath%>index/footer.html" frameborder="0"
				scrolling="no" width="100%" ; height="90px;"></iframe>
	</body>
	<script>
       var basepath="<%=basePath%>";
       var  userid="<%=userid%>";
       var userType = "<%=userType%>"
       var joinFlag = '<s:property value="#joinFlag"/>';
  function add(){
  	if(userid == ''){
  		alert('您还未登录，请先登录!');
  		return;
  	}
  	if(userType != '3'){
  		alert('只有业主才可以参加拼购!');
  		return;
  	}
              var  username= $("#username").val();
              if(""== username){
                  alert("请填写真实姓名");
                   $("#username").focus();
                   return ;
              }
              var  phone= $("#phone").val();
              if(""== phone){
                  alert("请填写手机");
                 $("#phone").focus();
                  return ;
              }
              var  address= $("#address").val();  
              if(""== address){
                  alert("请填写小区名称");
                  $("#address").focus();
                  return ;
              }
              var  parttime= $("#parttime").val();  
              if(""== parttime){
                  alert("请选择参加拼购时间");
                  $("#parttime").focus();
                  return ;
              }
            
               var  num= $("#num").val();  
              if(""== num){
                  alert("请填写购买数量");
                  $("#num").focus();
                  return ;
              }
			document.getElementById('cjpgbtn').click();
				tipFlag = true;
				alert("申请参加拼购成功");
				$("#username").val("");
		      	$("#phone").val("");
		        $("#address").val(""); 
		         $("#tel").val(""); 
		         $("#parttime").val("");
		         $("#num").val("");
		         $("#xun").val("");
		         $("#type").val("");
		         $("#wuname").val("");
		         $("#xuntotal").val("");
		         $("#zhekou").val("");
		         $("#time").val("");
			
		}
		
		function initIframeHeight(height){
			if(height<1000)
				height = 1000
			$("#test").css({height:height+'px'})
		}
		
		function getHeight(id){
			return jQuery('#'+id).height();
		}
		jQuery('.leftBody').height(getHeight('left')-10);
		function addfavorite()
		{
		    window.external.addFavorite('http://www.9898sj.com','幸福兄弟')  ;
		} 
</script>
</html>
<SCRIPT FOR=window EVENT=onload LANGUAGE="JScript">
document.all("test").height=test.document.body.scrollHeight;
</SCRIPT>



